<?php

class Default_Form_Register extends Zend_Form
{

    public function init()
    {
        $fullname = new Zend_Form_Element_Text("fullname");
        $fullname->setLabel("Họ & Tên (*)")
                 ->setRequired(true)
                 ->removeDecorator("HtmlTag");
        
        $gender = new Zend_Form_Element_Select("gender");
        $gender->setLabel("Giới Tính")
                ->removeDecorator("HtmlTag")
                ->setRequired(true);
        $gender->addMultiOptions(array(
                "Nam" => "Nam",
                "Nữ"  => "Nữ",
        ));
        
        $email = new Zend_Form_Element_Text("email");
        $email->setLabel("Email (*)")
              ->setRequired(true)
              ->removeDecorator("HtmlTag")
              ->addFilters(array(
                      "StringTrim",
                      "StripTags",
              ))
              ->addValidator("EmailAddress", TRUE);
              
        $pass = new Zend_Form_Element_Password("password");
        $pass->setRequired(TRUE)
             ->setLabel("Mật khẩu (*)")
//              ->addValidator('stringLengh', true, array(6))
             ->addFilters(array(
                      "StringTrim",
                      "StripTags",
              ))
              ->removeDecorator("HtmlTag");
        
         $repass = new Zend_Form_Element_Password("repassword");
         $repass->setRequired(TRUE)
                 ->setLabel("Nhập lại mật khẩu")
                 ->addFilters(array(
                         "StringTrim",
                         "StripTags",
                 ))
                 ->removeDecorator("HtmlTag");
             
        $address = new Zend_Form_Element_Text("address");
        $address->setRequired(true)
                ->setLabel("Địa Chỉ (*)")
                ->removeDecorator("HtmlTag");
        
        $phone = new Zend_Form_Element_Text("phone");
        $phone->setLabel("Số Điện Thoại")
                ->removeDecorator("HtmlTag")
                ->addFilter("Alnum");
        $txtcaptcha = new Zend_Form_Element_Text('txtcaptcha');
        $txtcaptcha->setRequired(true)
                   ->removeDecorator("HtmlTag")
                   ->removeDecorator("Label");
        
        $submit = new Zend_Form_Element_Submit("register");
        $submit->setLabel("Đăng ký")
                ->removeDecorator("DtDdWrapper");
        $this->addElements(array($fullname, $email, $gender, $pass, $repass, $address, $phone, $txtcaptcha,  $submit));
        
    }


}

